home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-21 | 670 b | 23 lines | [TEXT/RLAB] |
- members:
-
- Syntax: members ( L )
-
- Description:
-
- The members function takes a single list as an argument (L),
- and returns a string-vector containing the list's member
- names.
-
- For example: `x = members ($$)' will create a row-vector
- (type: string) and assign it to `x'. The row-vector will
- contain the names of all the elements of the
- global-symbol-table.
-
- The members function is probably most useful when used in
- conjunction with for-loops. The result of members() can be
- used as the loop index, allowing users to operate on the
- elements of a list:
-
- ll = << a = rand(3,3); b = rand(3,3); c = rand(3,3) >>;
- for (i in members (ll)) { ll.[i] = diag(ll.[i]); }
-